<template>
  <v-app>
    <div class="header">
      <div class="header-info">
        <router-link to="/index">
          <img src="./assets/logo.png" alt="CodesDog" class="logo" />
          <p class="navbar-left">代码狗</p>
        </router-link>
        <router-link class="navbar-left" to="/admin">
          <p class="navbar-left">
            &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
          </p>
        </router-link>
        <session></session>
      </div>
    </div>
    <div v-bind:class="holderClass">
      <router-view></router-view>
    </div>
  </v-app>
</template>
<style>

</style>
<script>
import Session from '@/components/SessionView'
import 'whatwg-fetch'
function Logger(debug) {
  this.debug = debug;
  if (debug) {
    this.log = console.log
  } else {
    this.log = function () {

    }
  }
  return this
}
var debug = false
var logger = new Logger(debug)
window.logger = logger
export default {
  name: 'app',
  data: function () {
    return {
      msg: 'hello'
    }
  },
  beforeRouteUpdate(to, from, next) {
    logger.log('test app')
  },
  computed: {
    holderClass: function () {
      var path = this.$route.path
      return {
        holder: path.indexOf('/article') == 0 || path == '/' || path == '/index'||path.indexOf('/admin')==0
      }
    }
  },
  components: {
    Session: Session
  },
  mounted: function () {

  }
}
</script>

<style>
body,
html {
  height: 100%;
  overflow: none;
}

#app {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #1D1F21;
}

a {
  text-decoration: underline;
  color: #5e66d4;
}

p {
  margin: 5px;
  padding: 0px;
}

.header {
  width: 100%;
  color: #ddd;
  position: fixed;
  top: 0px;
  left: 0px;
  background: rgba(214, 214, 214, 0.78);
  z-index: 10;
}

.header a {
  color: #787878;
}

.header a:hover {
  color: #bbb;
}

.header-info {
  max-width: 1070px;
  margin: auto;
  width: 100%;
}

.logo {
  width: 40px;
  display: inline-block;
  float: left;
  margin: 2px 0px 0px -8px;
  border-style: none;
  padding: 2px;
  vertical-align: middle;
}

.holder {
  margin: 80px auto 0px auto;
  max-width: 1070px;
  width: 100%;
}

.background {
  width: 100%;
  height: 100%;
  z-index: -1000;
  position: fixed;
  background: #787878;
  background-size: cover;
  top: 0px;
  left: 0px;
}

.navbar-left {
  display: inline-block;
  float: left;
  margin: 12px 0px 0px 0px;
}

.navbar-right {
  display: inline-block;
  float: right;
  margin: 6px -12px;
}

.panel {
  margin-bottom: 10px;
  background-color: #fff;
  border: 1px solid transparent;
  border-radius: 4px;
  -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
}

.panel-footer {
  padding: 10px 15px;
  background-color: #f5f5f5;
  border-top: 1px solid #ddd;
  border-bottom-right-radius: 3px;
  border-bottom-left-radius: 3px;
  font-size: 14px;
}

.panel-default {
  border-color: #ddd;
}

.panel-default>.panel-heading {
  color: #333;
  background-color: #f5f5f5;
  border-color: #ddd;
}

.panel-success {
  border-color: #d6e9c6;
}

.panel-success>.panel-heading {
  color: #1b1f1b;
  background-color: #ebfbe4;
  border-color: #d6e9c6;
}

.panel-danger {
  border-color: #ebccd1;
}

.panel-danger>.panel-heading {
  color: #a94442;
  background-color: #f2dede;
  border-color: #ebccd1;
}

.panel-heading {
  padding: 10px 15px;
  border-bottom: 1px solid transparent;
  border-top-left-radius: 3px;
  border-top-right-radius: 3px;
}

.panel-body {
  padding: 15px;
}

.panel-title {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 16px;
  color: inherit;
  text-align: center;
}

.pans {
  margin: 310px auto auto auto;
  width: 360px;
  z-index: 0
}

.form-control {
  z-index: 1
}

.button {
  margin-top: 20px;
  width: 100%
}
</style>
